package com.ry.controller;

import com.ry.common.CommonResult;
import com.ry.model.dto.FollowerDTO;
import com.ry.model.entity.Follower;
import com.ry.service.FollowerService;
import com.ry.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ry
 * @since 2021-11-13 11:13
 **/
@RestController
@RequestMapping("/follower")
public class FollowerController {
    @Autowired
    private FollowerService followerService;

    @PostMapping("/like")
    public CommonResult<Void> like(FollowerDTO followerDTO){
        followerService.add(followerDTO);

        return ResultUtil.success();
    }

    @DeleteMapping("/unLike")
    public CommonResult<Void> unLike(FollowerDTO followerDTO){
        followerService.delete(followerDTO);

        return ResultUtil.success();
    }
}
